import { getApplicationContainer } from './../../get-application-container';

// index.ts
// 获取应用实例
const app = getApp<IAppOption>()

Page({
    data: {
        userInfo: {}
    },
    
    onShow() {
        if(getApplicationContainer().authService.token){
            wx.getUserInfo({
                success: async res => {
                    this.setData({userInfo: res.userInfo})
                },
            })
        } else {
            getApplicationContainer().dialogService.confirm('快捷登入后才能继续探索哦', () => {
                wx.redirectTo({
                    url: '/pages/auth/index'
                });
            });
        }
    }
})
